<?php
include "./Classes/DB.class.php";

$db = new DB();

if(isset($_GET["categoria"])){
	

		
	
	$sql = "SELECT scat_id AS id, scat_nome AS subcategoria FROM subcategoria WHERE cat_id = ?;";
	$subcategorias = $db->executarQuery($sql, array('s',$_GET["categoria"]), false,true);
	
	//print_r($subcategorias);
	print(" <meta charset=\"iso-8859-1\">");
	echo("<option value=-1> Qualquer uma </option>");
	foreach ($subcategorias as $subcategoria)
		printf("\n<option value = %d>%s</option>",$subcategoria["id"],$subcategoria["subcategoria"]);
		
	
	}
?>